

package com.hazelcast.aws;

import com.hazelcast.internal.util.StringUtil;

/**
 * This class is introduced to lookup system parameters.
 */
class Environment {
    private static final boolean IS_RUNNING_ON_ECS = isRunningOnEcsEnvironment();

    private static boolean isRunningOnEcsEnvironment() {
        String execEnv = System.getenv("AWS_EXECUTION_ENV");
        return !StringUtil.isNullOrEmptyAfterTrim(execEnv) && execEnv.contains("ECS");
    }

    boolean isRunningOnEcs() {
        return IS_RUNNING_ON_ECS;
    }
}
